#include "widget.h"
#include "ui_widget.h"
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QFont font;
    //设置文本大小
    font.setPointSize(15);
    ui->label->setFont(font);
    ui->label_2->setFont(font);
    ui->label_3->setFont(font);

    //给下拉框设置条目
    ui->comboBox->addItem("麦辣鸡腿堡");
    ui->comboBox->addItem("巨无霸");
    ui->comboBox->addItem("培根酥脆双层牛堡");

    ui->comboBox_1->addItem("炸鸡");
    ui->comboBox_1->addItem("薯条");
    ui->comboBox_1->addItem("土豆泥");

    ui->comboBox_2->addItem("可乐");
    ui->comboBox_2->addItem("牛奶");
    ui->comboBox_2->addItem("咖啡");

    //设置微调框的数量限制
    ui->spinBox->setMinimum(1);
    ui->spinBox->setMaximum(5);

    ui->spinBox_1->setMinimum(1);
    ui->spinBox_1->setMaximum(5);

    ui->spinBox_2->setMaximum(1);
    ui->spinBox_2->setMaximum(5);

    //设置微调框的初始值
    ui->spinBox->setValue(1);
    ui->spinBox_1->setValue(1);
    ui->spinBox_2->setValue(1);

}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    qDebug()<<ui->comboBox->currentText()<<":"<<ui->spinBox->value();
    qDebug()<<ui->comboBox_1->currentText()<<":"<<ui->spinBox_1->value();
    qDebug()<<ui->comboBox_2->currentText()<<":"<<ui->spinBox_2->value();

}
